New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/mvt

Package Overview
Dependencies
Maintainers
9
Versions
272
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/mvt

Loader for Mapbox Vector Tiles

  • 3.4.15
  • Source
  • npm
  • Socket score

Version published
Maintainers
9
Created

What is @loaders.gl/mvt?

@loaders.gl/mvt is a module within the loaders.gl framework that provides tools for loading and parsing Mapbox Vector Tiles (MVT). It is designed to handle large-scale geospatial data efficiently and can be used in web applications to render vector tiles on maps.

What are @loaders.gl/mvt's main functionalities?

Loading MVT Data

This feature allows you to load MVT data from a given URL. The `load` function from `@loaders.gl/core` is used in conjunction with the `MVTLoader` to fetch and parse the MVT data.

const { MVTLoader } = require('@loaders.gl/mvt');
const { load } = require('@loaders.gl/core');

async function loadMVT(url) {
  const data = await load(url, MVTLoader);
  console.log(data);
}

loadMVT('https://example.com/tile.mvt');

Parsing MVT Data

This feature allows you to parse MVT data from an ArrayBuffer. The `parse` function from `@loaders.gl/core` is used with the `MVTLoader` to convert the binary data into a usable format.

const { MVTLoader } = require('@loaders.gl/mvt');
const { parse } = require('@loaders.gl/core');

async function parseMVT(arrayBuffer) {
  const data = await parse(arrayBuffer, MVTLoader);
  console.log(data);
}

// Assuming arrayBuffer is an ArrayBuffer containing MVT data
parseMVT(arrayBuffer);

Handling Large Datasets

This feature allows you to handle large datasets by loading MVT data in batches. The `loadInBatches` function from `@loaders.gl/core` is used with the `MVTLoader` to fetch and process the data in smaller chunks, which is useful for performance optimization.

const { MVTLoader } = require('@loaders.gl/mvt');
const { loadInBatches } = require('@loaders.gl/core');

async function loadMVTInBatches(url) {
  const iterator = await loadInBatches(url, MVTLoader);
  for await (const batch of iterator) {
    console.log(batch);
  }
}

loadMVTInBatches('https://example.com/large-tile.mvt');

Other packages similar to @loaders.gl/mvt

Keywords

FAQs

Package last updated on 05 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc